import Vue from 'vue'
import VueRouter from 'vue-router'
/* import Welcome from '../components/Welcome.vue' */
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('@/components/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/welcome',
    component: () => import('@/components/Home.vue'),
    children: [
      { path: '/welcome', name: 'Welcome', component: () => import('@/components/Welcome') },
      {
        path: '/welcome',
        name: 'welcome',
        component: () => import('@/components/Welcome')
      },
      {
        path: '/shoplist',
        name: 'Shoplist',
        component: () => import('@/components/shop/shop-list')
      },
      { path: '/shoplist/shopdetail', name: 'shop-detail', component: () => import('@/components/shop/components/shop-detail') },
      { path: '/shoplist/analyze', name: 'goods-analyze', component: () => import('@/components/shop/components/goods-analyze') },
      { path: '/shopcheck/audit', name: 'audit', component: () => import('@/components/shop/components/audit') },
      {
        path: '/goodslist',
        name: 'GoodsList',
        component: () => import('@/components/shop/goods-list')
      },
      {
        path: '/shopchecked',
        name: 'Shopchecked',
        component: () => import('@/components/shop/openshop-check')
      },
      {
        path: '/shopequity',
        name: 'Shopequity',
        component: () => import('@/components/shop/shop-equity')
      },
      {
        path: '/shopindusty',
        name: 'Shopindusty',
        component: () => import('@/components/shop/shop-industry')
      },
      {
        path: '/goodscategory',
        name: 'Goodscategory',
        component: () => import('@/components/shop/shop-category')
      },
      {
        path: '/goodscategory/subclass',
        name: 'subclass',
        component: () => import('@/components/shop/components/subclass')
      },
      {
        path: '/shabusiness',
        name: 'businessShare',
        component: () => import('@/components/business/businessShare.vue')
      },
      {
        path: '/perbusiness',
        name: 'businessPersonage',
        component: () => import('@/components/business/businessPersonage.vue')
      },
      {
        path: '/PbMan',
        name: 'PbMan',
        component: () => import('@/components/business/PbMan.vue')
      },
      {
        path: '/orderlist',
        name: 'orderlist',
        component: () => import('@/components/order/orderList')
      },
      {
        path: '/orderstatistics',
        name: 'orderstatistics',
        component: () => import('@/components/order/orderstatistics')
      },
      {
        path: '/lookorder',
        name: 'lookorder',
        component: () => import('@/components/lookorder')
      },
      {
        path: '/comcoupon',
        name: 'Comcoupon',
        component: () => import('@/components/discount/common_discount')
      },
      {
        path: '/shopcoupon',
        name: 'Shopcoupon',
        component: () => import('@/components/discount/store_discount.vue')
      },
      {
        path: '/prolist',
        name: 'Prolist',
        component: () => import('@/components/Promotion/Promotion-list')
      },
      {
        path: '/details',
        name: 'details',
        component: () => import('@/components/Details/Details')
      },
      {
        path: '/govesource',
        name: 'Govesource',
        component: () => import('@/components/material/official-material')
      },
      {
        path: '/sourcecheck',
        name: 'Sourcecheck',
        component: () => import('@/components/material/sourcecheck')
      },
      {
        path: '/usersource',
        name: 'Usersource',
        component: () => import('@/components/material/usersource')
      },
      {
        path: '/withdraw',
        name: 'Withdraw',
        component: () => import('@/components/financialManagement/WithDraw.vue')
      },
      {
        path: '/platincome',
        name: 'Platincome',
        component: () => import('@/components/financialManagement/PlatinCome.vue')
      },
      {
        path: '/platexpend',
        name: 'Platexpend',
        component: () => import('@/components/financialManagement/PlatexPend.vue')
      },
      {
        path: '/accountman',
        name: 'Accountman',
        component: () => import('@/components/Systemsettings/Accountman')
      },
      {
        path: '/parameter',
        name: 'Parameter',
        component: () => import('@/components/Parametersetting/Parameter-setting')
      }
    ]
  }
]
const router = new VueRouter({
  routes
})

export default router
